home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / cool.lha / ice / pisces / mkdepend / def.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-04  |  3.0 KB  |  124 lines

  1. /**
  2.  ** MODIFIED: 05/11/90 by MBN
  3.  **
  4.  ** Added default pathname separator character
  5.  **/
  6.  
  7. #ifndef PATHSEP
  8. #define PATHSEP '/'
  9. #endif
  10.  
  11. /*
  12.  * $XConsortium: def.h,v 1.8 89/06/13 18:52:47 jim Exp $
  13.  */
  14. #include <stdio.h>
  15. #include <ctype.h>
  16.  
  17. #ifdef VMS
  18. #include <types.h>
  19. #include <stat.h>
  20. #else
  21. #ifdef os2
  22. #include <sys\types.h>
  23. #include <fcntl.h>
  24. #include <sys\stat.h>
  25. #else
  26. #include <sys/types.h>
  27. #include <fcntl.h>
  28. #include <sys/stat.h>
  29. #endif
  30. #endif
  31.  
  32. #ifdef USG
  33. #define u_char        unchar
  34. #endif
  35.  
  36. #define MAXDEFINES    512
  37. #define MAXFILES    512
  38. #define MAXDIRS        10
  39. #define SYMTABINC    10    /* must be > 1 for define() to work right */
  40. #define    TRUE        1
  41. #define    FALSE        0
  42.  
  43. /* the following must match the directives table in main.c */
  44. #define    IF        0
  45. #define    IFDEF        1
  46. #define    IFNDEF        2
  47. #define    ELSE        3
  48. #define    ENDIF        4
  49. #define    DEFINE        5
  50. #define    UNDEF        6
  51. #define    INCLUDE        7
  52. #define    LINE        8
  53. #define    PRAGMA        9
  54. #define ERROR           10
  55. #define IDENT           11
  56. #define SCCS            12
  57. #define ELIF            13
  58. #define EJECT           14
  59. #define IFFALSE         15     /* pseudo value --- never matched */
  60. #define ELIFFALSE       16     /* pseudo value --- never matched */
  61. #define INCLUDEDOT      17     /* pseudo value --- never matched */
  62.  
  63. #ifdef DEBUG
  64. extern int    debug;
  65. #define    debug0    ((debug&0x0001)==0) ? debug : log /* show ifn*(def)*,endif */
  66. #define    debug1    ((debug&0x0002)==0) ? debug : log /* trace defined/!defined */
  67. #define    debug2    ((debug&0x0004)==0) ? debug : log /* show #include */
  68. #define    debug3    ((debug&0x0008)==0) ? debug : log /* show #include SYMBOL */
  69. #define    debug4    ((debug&0x0010)==0) ? debug : log /* unused */
  70. #define    debug5    ((debug&0x0020)==0) ? debug : log /* unused */
  71. #define    debug6    ((debug&0x0040)==0) ? debug : log /* unused */
  72. #else
  73. #define    debug0
  74. #define    debug1
  75. #define    debug2
  76. #define    debug3
  77. #define    debug4
  78. #define    debug5
  79. #define    debug6
  80. #endif /* DEBUG */
  81.  
  82. typedef    unsigned char boolean;
  83.  
  84. struct symtab {
  85.     char    *s_name;
  86.     char    *s_value;
  87. };
  88.  
  89. struct    inclist {
  90.     char        *i_incstring;    /* string from #include line */
  91.     char        *i_file;    /* path name of the include file */
  92.     struct inclist    **i_list;    /* list of files it itself includes */
  93.     int        i_listlen;    /* length of i_list */
  94.     struct symtab    *i_defs;    /* symbol table for this file */
  95.     struct symtab    *i_lastdef;    /* last symbol defined */
  96.     int        i_deflen;    /* number of defines */
  97.     boolean        i_defchecked;    /* whether defines have been checked */
  98.     boolean        i_notified;    /* whether we have revealed includes */
  99.     boolean        i_marked;    /* whether it's in the makefile */
  100.     boolean        i_searched;    /* whether we have read this */
  101.     boolean         i_included_sym; /* whether #include SYMBOL was found */
  102.                     /* Can't use i_list if TRUE */
  103. };
  104.  
  105. struct filepointer {
  106.     char    *f_p;
  107.     char    *f_base;
  108.     char    *f_end;
  109.     long    f_len;
  110.     long    f_line;
  111. };
  112.  
  113. char            *copy();
  114. char            *malloc();
  115. int                     is_source_file();
  116. char            *realloc();
  117. char            *getline();
  118. struct symtab        *slookup();
  119. struct symtab        *defined();
  120. struct symtab        *fdefined();
  121. struct filepointer    *getfile();
  122. struct inclist        *newinclude();
  123. struct inclist        *inc_path();
  124.